package com.demo.money.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * incomedetails
 * @author 
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Incomedetails implements Serializable {
    /**
     * 主键id
     */
    private Integer id;

    /**
     * 所属id(0-无所属)
     */
    private Integer userId;

    /**
     * 0-无效,1-有效,2-待删除
     */
    private Integer valid;

    /**
     * 实际收入金额
     */
    private Float amountOfMoneyActual;

    /**
     * 税前收入金额
     */
    private Float amountOfMoney;

    /**
     * 大类别
     */
    private String largeClass;

    /**
     * 小类
     */
    private String subClass;

    /**
     * 备注
     */
    private String note;

    /**
     * 收入时间
     */
    private Date timeTransaction;

    /**
     * 记录时间
     */
    private Date timeLogin;

    private static final long serialVersionUID = 1L;


    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Incomedetails other = (Incomedetails) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getValid() == null ? other.getValid() == null : this.getValid().equals(other.getValid()))
            && (this.getAmountOfMoneyActual() == null ? other.getAmountOfMoneyActual() == null : this.getAmountOfMoneyActual().equals(other.getAmountOfMoneyActual()))
            && (this.getAmountOfMoney() == null ? other.getAmountOfMoney() == null : this.getAmountOfMoney().equals(other.getAmountOfMoney()))
            && (this.getLargeClass() == null ? other.getLargeClass() == null : this.getLargeClass().equals(other.getLargeClass()))
            && (this.getSubClass() == null ? other.getSubClass() == null : this.getSubClass().equals(other.getSubClass()))
            && (this.getNote() == null ? other.getNote() == null : this.getNote().equals(other.getNote()))
            && (this.getTimeTransaction() == null ? other.getTimeTransaction() == null : this.getTimeTransaction().equals(other.getTimeTransaction()))
            && (this.getTimeLogin() == null ? other.getTimeLogin() == null : this.getTimeLogin().equals(other.getTimeLogin()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getValid() == null) ? 0 : getValid().hashCode());
        result = prime * result + ((getAmountOfMoneyActual() == null) ? 0 : getAmountOfMoneyActual().hashCode());
        result = prime * result + ((getAmountOfMoney() == null) ? 0 : getAmountOfMoney().hashCode());
        result = prime * result + ((getLargeClass() == null) ? 0 : getLargeClass().hashCode());
        result = prime * result + ((getSubClass() == null) ? 0 : getSubClass().hashCode());
        result = prime * result + ((getNote() == null) ? 0 : getNote().hashCode());
        result = prime * result + ((getTimeTransaction() == null) ? 0 : getTimeTransaction().hashCode());
        result = prime * result + ((getTimeLogin() == null) ? 0 : getTimeLogin().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", userId=").append(userId);
        sb.append(", valid=").append(valid);
        sb.append(", amountOfMoneyActual=").append(amountOfMoneyActual);
        sb.append(", amountOfMoney=").append(amountOfMoney);
        sb.append(", largeClass=").append(largeClass);
        sb.append(", subClass=").append(subClass);
        sb.append(", note=").append(note);
        sb.append(", timeTransaction=").append(timeTransaction);
        sb.append(", timeLogin=").append(timeLogin);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}